package ooad.gof.adapter;

/**
 * 对象适配器
 * 适用于外部为接口/类的情况
 *
 */
public class Adapter1 implements Target{
	private Adaptee adaptee;
	public Adapter1(){
		this.adaptee = new Adaptee(); //如果Adaptee为类
	}

	public void setAdaptee(Adaptee adaptee) {
		this.adaptee = adaptee; //如果Adaptee为接口，可以通过setter注入接口的实现类对象
	}

	@Override
	public void request() {
		this.adaptee.specificRequest();		
	}
}
